// 04myCenter/07workerEnterprise/workerEnterpriseList.js
var co = require('../../resource/js/common.js')
var _this,_data
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
     bizList:[],
     page:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
     _this = this
     _data = this.data
     console.log('biz',app.Data)
     this.getBizList()

  },
  //获取有员工的企业列表
  getBizList:function(){
     var url = 'jyhs/Admin/getBizList'
     co.getShareApi(url,{
        User_ID: app.Data.userInfo.User_ID,
        page:_data.page
     },function(res){
        if(res.code == 0){
           console.log(res)
           _data.page++
           var list = _data.bizList.concat(res.data)
           _this.setData({
              bizList: list
           })
        }
     })
  },
  onReachBottom(){
     this.getBizList()
  },
  //跳转到该员工列表
   toWorkerList:function(e){
      console.log('e',e)
      var biz_ID = e.currentTarget.dataset.biz_id
      var User_Identity = e.currentTarget.dataset.identity
      console.log('User_Identity', User_Identity)
      wx.navigateTo({
         url: '/04myCenter/07workerEnterprise/worker/worker?biz_ID=' + biz_ID + '&User_Identity=' + User_Identity,
      })
   },
})